<?php 
$weekarr = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
$week = $weekarr[date("w")];
?>
<div id="candidate" class="indexcontentdiv">
    <div class="positiondiv">
        <table>
            <tr>
                <td class="td-left">
                    <img src="<?=base_url()?>resource/img/home_ico.png" width="21" height="17">
                    <?=$this->lang->line("Report")?> > <?=$this->lang->line("Pickup Paper")?>
                </td>
                <td class="td-right">
                    <img src="<?=base_url()?>resource/img/menu2.png" width="27" height="24"><?=$this->lang->line("TodayIS")?> <?=$week?>,<?=date('M d,Y')?>
                </td>
            </tr>
        </table>
    </div>
    <div class="reminder-div">
        <div class="date-month-div" onselectstart="javascript:return false;">
            <div class="month-div-header">
                <table>
                    <tr>
                        <td><a href="<?=$ispickup == FALSE?base_url("reminder/index/".$lastmonth):base_url("reminder/pickuppaper/".$lastmonth)?>"><?=$this->lang->line("LAST MONTH")?></a></td>
                        <td colspan="5" style="font-size:16px;"><?=$current?></td>
                        <td><a href="<?=$ispickup == FALSE?base_url("reminder/index/".$nextmonth):base_url("reminder/pickuppaper/".$nextmonth)?>"><?=$this->lang->line("NEXT MONTH")?></a></td>
                    </tr>
                    <tr>
                        <td><?=$this->lang->line("SUNDAY")?></td>
                        <td><?=$this->lang->line("MONDAY")?></td>
                        <td><?=$this->lang->line("TUESDAY")?></td>
                        <td><?=$this->lang->line("WENDNESDAY")?></td>
                        <td><?=$this->lang->line("THURSDAY")?></td>
                        <td><?=$this->lang->line("FRIDAY")?></td>
                        <td><?=$this->lang->line("SATURDAY")?></td>
                    </tr>
                </table>
            </div>
            <div class="month-div-body">
                <?php foreach ($days as $key => $value) {?>
                <?php if(count($value['notices']) > 0){?>
                <div class="day-div hasnote" id="daydiv<?=$key?>" date="<?=$value['date']?>" onselectstart="javascript:return false;">
                <?php }else{?>
                <div class="day-div" id="daydiv<?=$key?>" date="<?=$value['date']?>" onselectstart="javascript:return false;">
                <?php }?>
                    <h3><?=$value['day']==0?"":$value['day']?></h3>
                    <table class="day-div-content">
                        <?php foreach ($value['notices'] as $index => $notice) {?>
                        <tr class="content-tr-<?=($index+1)?>">
                            <td>
                                <a href="javascript:void(0)" title="<?=($index+1).'.'.$notice['title'].'-'.$notice['noticetime']?>">
                                    <?=($index+1).'.'.$notice['title'].'-'.$notice['noticetime']?>
                                </a>
                            </td>
                        </tr>
                        <tr><td style="height:1px;"></td></tr>
                        <?php }?>
                    </table>
                </div>
                <?php }?>
            </div>
        </div>
    </div>
</div>
<script>
var click = 2;
$(".detail").click(function(){
    var id = $(this).attr("candidateid");
    var url = '<?=base_url()?>index/candidate_detail/'+id;
    location.href=url;
});

$("#new").click(function(){
    var url = '<?=base_url()?>index/new_candidate';
    location.href=url;
});

var thisday = "<?=$thisday?>";
if(thisday >= 0){
    $("#daydiv"+thisday).addClass("currentday");
}

$(".day-div").dblclick(function(){
    var date = $(this).attr("date");
    if(date != 0){
        var iTop = (document.body.clientHeight-30-600)/2; //获得窗口的垂直位置;
        var iLeft = (document.body.clientWidth-10-800)/2; //获得窗口的水平位置;
        window.open('<?=base_url("reminder/reminders")?>/'+date+'/<?=$ispickup?>','_blank',
        'width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,top=0,left=0'); 
    }
});
</script>
